import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex);
var store = new Vuex.Store({
	state:{
		userInfo:{},
		dataBody:uni.getStorageSync('dataBody'),
		shopDataBody:uni.getStorageSync('shopDataBody'),
		hasLogin:false,
		projects:[],
		appVersion:"",
		updateInfo:"",
		cstManageRefresh:false,
		color:{
			primary:"#3ECCA9",
			warning:"orangered",
			gray:"#787d83",
			border:"#eee",
			font:"#fff",
			backgroundGray:"#f6f7f9",
			shadow:"#505050",
			must:"#ff0000",
			ban:"#eee",
			color1:"#4fbed2",
			color2:"#EE7600",
			color3:"#fb665f",
			color4:"#88cb7e",
			color5:"#61b6f9",
			color6:"#f77896",
			color7:"#6F68DF",
		},
		power:null,
		projectCur:{},//当前选中的项目
	},
	mutations:{
		// 保存当前APP版本信息
		setAppVersion(state,provider){
			state.appVersion=provider
		},
		// 保存APP更新信息
		setUpdate(state,provider){
			state.updateInfo=provider
		},
		//	保存权限列表
		setPower(state,provider){
			state.power=provider
		},
		setDataBody(state,value){
			state.dataBody=value
			uni.setStorageSync('dataBody',value)
		},
		setShopDataBody(state,value){
			state.shopDataBody=value
			uni.setStorageSync('shopDataBody',value)
		}
		
		
	},
	// plugins: [createPersistedState()]  //vuex状态持久化
})
export default store;